/**
 * 
 */
package com.gosophia.conference.action.starting;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.security.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.web.action.BaseSupportAction;
import com.gosophia.oa.action.JudgeCurrentUndertaker;
import com.gosophia.springsecurity.UserDetailsImpl;
import com.gosophia.taskManagement.ws.TaskManagementWebService;

/**
 * 功能：进入会议页面
 * 
 * @author zhangdongsheng
 * @since 2011-3-23 Copyright (c) 2010 Gosophia corporation All Rights Reserved
 */
@Controller("ConferenceStartingEnterAction")
@Scope("prototype")
public class ConferenceStartingEnterAction extends BaseSupportAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Long jobId;

	@Autowired
	private TaskManagementWebService taskManagementWebService;

	@Autowired
	private JudgeCurrentUndertaker judgeCurrentUndertaker;

	@Override
	public String _execute() throws Exception {
		// 得到当前用户
		UserDetailsImpl userDetails = (UserDetailsImpl) SecurityContextHolder
				.getContext().getAuthentication().getPrincipal();
		Long creatorId = userDetails.getUserAccountDTO().getUserInfoDTO()
				.getUserInfoId();
		// 防止非法用户进行任务处理
		if (jobId != null) {
			judgeCurrentUndertaker.judgeOperationAuthority(jobId);
		}
		return SUCCESS;
	}

	public Long getJobId() {
		return jobId;
	}

	public void setJobId(Long jobId) {
		this.jobId = jobId;
	}

}
